<?php

namespace app\index\controller;

use app\common\controller\Frontend;
use app\common\library\Token;

class Article extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';

    public function _initialize()
    {
        parent::_initialize();
    }

    public function view($id)
    {    
        

        $map = [
                'id' => $id,
                'status' => 0,
            ];
        $data = db('article')->where($map)->order('weigh', 'desc')->find();
        if (empty($data)) {
            $this->redirect('index/index');
        }
        $this->view->assign('data', $data);     
        return $this->view->fetch();
    }





}
